package com.dailyblue.java.spring.ioc.annotation.pojo;

import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Data
@Component
@Lazy // 懒加载
@Scope(value = "singleton")
public class Score {
    @Value("98.5")
    private Double score;
    // byType
    // @Autowired
    // @Qualifier("stu") 结合着 @Autowired 一起使用，byType+byName
    // byName,byType
    @Resource
    private Student student;

    public Score() {
        System.out.println("====>Score类的对象被产生了");
    }
}
